package com.edu.app.service.impl.core;

import com.edu.app.bean.core.SysOpty;
import com.edu.app.mapper.core.SysOptyMapper;
import com.edu.app.model.OptyModel;

import com.edu.app.service.impl.SysBaseServiceImpl;
import com.edu.app.service.sys.core.SysOptyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOptyServiceImpl extends SysBaseServiceImpl<SysOpty,SysOptyMapper> implements SysOptyService {
    @Autowired
    SysOptyMapper sysOptyMapper;

    public PageInfo getOptyModelByPage(Integer user_id, Integer currentPage, Integer pageSize){
        PageHelper.startPage(currentPage, pageSize, true);
        List<OptyModel> list = sysOptyMapper.getOptyModel(user_id);

        PageInfo<OptyModel> pageInfo = new PageInfo<OptyModel>(list);
        return pageInfo;
    }
}
